<template>
	<!-- 供应链 -->
	<view class="" style="margin-top: 20rpx;">
		 <!-- v-for="(item,index) in list" :class="index%2==0?'ecpire':''" -->
		<view class="item"  v-for="(item,index) in list" :key="item.id">
			<view class="acea-row row-middle row-between top-info" v-if="canClose">
				<!-- <view>3天内更新</view> -->
				<view class="close">×</view>
			</view>
			<view class="acea-row row-middle row-between sell-goods" @click="toDetail(item.id)">
				<view class="goods-img">
					<image :src="reImg(item)" mode="" class="img"></image>
	<!-- 				<view class="tag line1" v-if="index%2==0">
						已失效
					</view> -->
					<!-- <view class="tag line1" v-else>
						好货上新
					</view> -->
		<!-- 			<view class="acea-row row-middle distance">
						<image src="@/static/images/location.png" mode=""></image>
						<text>距您1.4km</text>
					</view> -->
				</view>
				<view class="acea-row  goods-info row-column-between" style="padding: 10rpx 15rpx;">
					<view class="title line2">
						{{item.title}}
					</view>

					<view class="acea-row row-middle">
						<view class="sell-price">
							价格<text style="margin-left: 10rpx;">{{item.commodityPrice?item.commodityPrice:0}}</text>元
						</view>
					</view>
					<!-- <view class="acea-row row-middle">
						<view class="sell-price">
							数量<text>{{item.commodityNum}}</text>
						</view>
					</view> -->
					<!-- <view class="gold-coin">
						<image src="@/static/images/goldcoin_icon_gray.png" mode="" v-if="index%2==0"></image>
						<image src="@/static/images/goldcoin_icon.png" mode="" v-else></image>
						<view class="num">25800</view>
					</view> -->
					<view class="acea-row goods-tag">
						<view class="tag" v-for="tags in item.serviceCharacteristics?item.serviceCharacteristics.split('/'):[]" :key="tags">{{tags}}</view>
<!-- 						<view class="tag">关键词2</view>
						<view class="tag">7年老店</view> -->
					</view>
				</view>
			</view>
		
			<view class="acea-row row-middle row-between visit-box" v-if="toZx">
<!-- 				<view class="visit-advtar-box">
					<view class="visit-advtar">
						<image src="@/static/images/f.png" mode="" v-for="(item,index) in visitInfo" :key="index"
							:style="{left: (30 * index) + 'rpx'}"></image>
					</view>
					<view class="visit-num">18288人浏览 已成功匹配12254人</view>
				</view> -->
				<view class="visit-advtar-box">
					<view class="visit-advtar" @click="toVisitor(item)">
						<image :src="m.avatar" mode="" v-for="(m,ind) in item.managementResponse?item.managementResponse:[]"
							:key="ind" :style="{left: (20 * ind) + 'rpx'}"></image>
					</view>
					<!-- <view class="visit-num">{{item.view ||  0}}人浏览 已成功匹配{{item.matchingNum?item.matchingNum:0}}人 -->
					<view class="visit-num">{{item.view ||  0}}人浏览 已成功匹配{{ Math.floor(Math.random() * (500 - 50 + 1)) + 50 }}人 
					</view>
				</view>
		
				<view class="visit-l">
					<!-- <view class="visit-num">5866人咨询</view> -->
					<view class="visit-btn" @click="toContact(item.contacts)">
						立即咨询
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default{
		// 商铺专区列表项
		name:'goldItem',
		props:{
			list:{
				type:Array,
				default:()=>{
					return [1,1,1]
				}
			},canClose:{
				type:Boolean,
				default:()=>{
					return false
				}
			},
			detail:{
				type:Object,
				default:()=>{
					return {}
				}
			},
			toZx:{
				type:Boolean,
				default:()=>{
					return true
				}
			}
		},
		data(){
			return{
				visitInfo:[1,1,1,1,1,1,1,1,1,1,1]
			}
		},
		methods:{
			reImg(d){
				return d.imaegs?d.imaegs:this.$noImageShow; 
			},
			toDetail(id){
				uni.navigateTo({
					url:'/pages/details/supplyChain/supplyChain?id='+id
				})
			},
			toVisitor(data) {
				data.vistype = 4;
				uni.navigateTo({
					url: "/pages/aboutUsers/aboutUsers/visitor?mind=&data=" + JSON.stringify(
						data)
				})
			},
			toContact(contact){
				if(!contact || contact.length < 1){
					this.$util.Tips({
						title:'赞未获取到联系人'
					})
					return;
				}
				getApp().globalData.into_singleChatRoom({
					phone:contact[0].contactPhone,
					contactId:contact[0].contactId,
				})
			}
		},
		mounted() {
			
		}
	}
</script>

<style lang="scss" scoped>
	@import "index.scss";
</style>